<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电影订票页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f5f5;
        }
        .nav {
            display: flex;
            justify-content: space-around;
            background-color: #333;
            color: rgb(255, 255, 255);
            padding: 10px 0;
        }
        .nav a {
            color: white;
            text-decoration: none;
        }
        .auth {
            text-align: right;
            padding: 10px 20px;
            background-color: #333;
        }
        .auth a {
            color: white;
            text-decoration: none;
            margin: 0 5px;
        }
        .auth a:hover {
            text-decoration: underline;
        }
        .order-container {
            max-width: 500px;
            margin: 20px auto;
            padding: 20px;
            background-color: white;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .order-title {
            text-align: center;
            font-size: 24px;
            margin-bottom: 20px;
        }
        .order-info {
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid #eee;
        }
        .submit-btn {
            display: block;
            width: 100%;
            padding: 10px;
            background-color: #ff4500;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .submit-btn:hover {
            background-color: #e03e00;
        }
        .movie-title {
            text-align: center;
            margin-top: 30px;
            font-weight: bold;
        }
        .author {
            text-align: center;
            color: #666;
            margin-top: 5px;
        }
        /* Modal styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 1;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.4);
        }
        .modal-content {
            background-color: #fefefe;
            margin: 15% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 80%;
            max-width: 300px;
            text-align: center;
            border-radius: 5px;
        }
        .modal-btn {
            padding: 8px 20px;
            background-color: #ff4500;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin-top: 15px;
        }
    </style>
</head>
<body>
    <div class="nav">
        <a href="首页.html">首页</a>
        <a href="首页.html">电影</a>
        <a href="首页.html">电视剧</a>
        <a href="首页.html">电影院</a>
    </div>

    <div class="auth">
        <a href="登录.html">登录</a> | <a href="注册.html">注册</a>
    </div>

    <div class="order-container">
        <div class="order-title">订票</div>
        
        <div class="order-info">
            <div>位置：9排2座/3座</div>
        </div>
        
        <div class="order-info">
            <div>价格：￥777.00</div>
        </div>
        
        <div class="order-info">
            <div>时间：13:00-16:00</div>
        </div>
        
        <button class="submit-btn" id="submitOrder">提交订单</button>
    </div>

    <div class="movie-title">电影</div>
    <div class="author">唐依依</div>

    <!-- 成功消息的弹出框 -->
    <div id="successModal" class="modal">
        <div class="modal-content">
            <p>订票成功！</p>
            <button class="modal-btn" id="closeModal"><a href="首页.html">好的</a></button>
        </div>
    </div>

    <script>
        // 获取模态元素
        const modal = document.getElementById("successModal");
        const submitBtn = document.getElementById("submitOrder");
        const closeBtn = document.getElementById("closeModal");

        // 当用户点击提交按钮时，打开模态框 
        submitBtn.onclick = function() {
            modal.style.display = "block";
        }

        // 当用户点击“好的”时，关闭模态框
        closeBtn.onclick = function() {
            modal.style.display = "none";
        }

        // 当用户点击模态框以外的任何位置时，关闭它
        window.onclick = function(event) {
            if (event.target == modal) {
                modal.style.display = "none";
            }
        }
    </script>
</body>
</html>